<!-- This page contains all of the code for the actual abstract submission page.
	This page displays all of the proper fields and sends the data to abstrSubmit.php for processing-->

<?php include 'header.php';?>
		<?php if(!isset($_SESSION['user'])):  ?>
			<meta http-equiv="refresh" content="0;URL=login.php">
		<?php else: ?>
<?php include 'abstrSubmit.php';?>
		<h2>Submit an Abstract</h2>
		
		<div class="formBox">
			<h3>Author Information</h3><br>
			<form method="post" enctype="multipart/form-data" action="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]);?>">
				<table>
					<tr><td>First Name:</td> <td><input type="text" name="fname" value="<?php echo $fname?>">
					<span class="error">* <?php echo $fnameErr;?></span></td></tr>
					<tr><td>Last Name:</td> <td><input type="text" name="lname" value="<?php echo $lname?>">
					<span class="error">* <?php echo $lnameErr;?></span></td>
					<tr><td>Email:</td> <td><input type="text" name="email" value="<?php echo $email?>">
					<span class="error">* <?php echo $emailErr;?></span></td></tr>
				</table>
		</div>
		<br>
		<div class="formBox">
			<h3>Academic Information</h3><br>
			<table>
				<tr><td>University Name:</td> <td><input type="text" name="school" value="<?php echo $school?>">
				<span class="error">* <?php echo $schoolErr;?></span></td></tr>
				
				<tr><td>Department:</td> <td><input type="text" name="major" value="<?php echo $major?>">
				<span class="error">* <?php echo $majorErr;?></span></td></tr>

				<tr><td>Advisor:</td> <td><input type="text" name="advisor" value="<?php echo $advisor?>">
				<span class="error"> <?php echo $advisorErr;?></span></td></tr>

				<tr><td>ACM Membership #:</td> <td><input type="text" name="acm_id" value="<?php echo $acm_id?>">
				<span class="error"><?php echo $acm_idErr;?></span></td></tr>
				
				<tr><td>Are you a member of SIGBio? </td>
				<td><input type="radio" name="sig" <?php if (isset ($sig) && $sig=="1") echo "checked";?> value="1">Yes
				<input type="radio" name="sig" <?php if (isset ($sig) && $sig=="0") echo "checked";?> value="0">No
				<span class="error">*<?php echo $sigErr;?></span><br></td></tr>
			</table>
		</div>
		
		<br>
		
		<div class="formBox">
			<h3>Abstract Information</h3><br>
			<table>
				<tr><td>Dissertation Title:</td> <td> <input type="text" name="title" value="<?php echo $title?>">
				<span class="error">* <?php echo $titleErr;?></span></td></tr>
				
				<tr><td>Keywords: </td> <td><input type="text" name="keywords" value="<?php echo $keywords?>">
				<span class="error"> <?php echo $keywordsErr;?></span></td></tr>
				
				<tr><td>Link to full dissertation:</td> <td> <input type="text" size="50" name="link" value="<?php echo $link?>">
				<span class="error"> <?php echo $linkErr;?></span></td></tr>
				<?php if(!empty($_POST['link'])) echo $_POST['link'] . "<br>"; ?>
			</table>
				
			<br>
			<h3>File Upload</h3><br>
			<span class="error"><?php echo $submissionErr; ?></span>
			<p>Please upload a .pdf of the abstract for your dissertation.</p>

			<!-- Sets the maximum file size to 1 MB -->
			<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
			<!-- Creates a buttom that brings up a file explorer to pick your file. -->
			<input name="upload" size="30" type="file" /><span class="error"><?php echo $fileErr; ?></span><br><br>
			
			
			<p>Comments: </p><br>
			<textarea name="comment" rows="10" cols="80" class="contain_width"><?php echo $filename;?></textarea>
						
			<p><span class="error">* required</span></p>
		</div>
		
			<input type="submit" name="submit" value="Submit">
		</form>
		<?php endif; ?>
<?php include 'footer.php'; ?>
